<template>
	<view class="relative-position">
		<image :src="detail.thumb" mode="widthFix" class="origin-img"></image>
		<view class="padding-10">
			<u-form :model="infoForm" :labelWidth="80">
				<u-form-item label="零钱余额" prop="manName">
					<u-input placeholder="零钱余额" type="digit" maxlength="10" v-model="infoForm.manName" />
				</u-form-item>

				<u-button text="立即生成" color="#FFC107" @click="onSaveData" class="margin-top-10"></u-button>
			</u-form>
		</view>
		<l-painter :board="poster" isCanvasToTempFilePath @success="getImg($event)" hidden />
		<video-a-d />
	</view>
</template>

<script>
	import {
		base64ToPath
	} from 'image-tools';
	import Loading from '../../components/loading';

	export default {
		components: {
			Loading,
		},
		data() {
			return {
				isInters: true,
				poster: {},
				infoForm: {
					manName: '',
					profName: '',
				},
				showPop: false,
				imgUrl: '',
				detail: {

				},
			};
		},
		mounted() {},
		methods: {
			onSaveData() {
				if (!this.infoForm.manName) {
					this.$util.showToast('请填写完整信息');
					return;
				}
				this.$util.showLoading('生成中，请耐心等待');
				this.showIntersAD();
				this.poster = {
					css: {
						width: '750rpx',
						position: 'relative',
					},
					views: [{
							type: 'image',
							src: this.detail.img,
							css: {
								width: '100%',
								minHeight: '200rpx',
							},
						},
						{
							type: 'text',
							text: this.infoForm.manName,
							css: {
								fontSize: '80rpx',
								fontWeight: 600,
								position: 'absolute',
								top: '410rpx',
								left: '304rpx',
								color: '#000000',
								zIndex: 10,
							},
						},
					],
				};

				// poster=posterData
			},

		},
	};
</script>

<style lang="scss" scoped>
	.origin-img {
		width: 100%;
		display: block;
		min-width: 100px;
	}
</style>
